#include <iostream>

using namespace std;

int zong(int num);

int main(void)
{
	int num;
	int sum;

	cout << "number: ";
	cin >> num;

	sum = zong(num);	

	cout << sum << endl;

	return 0;
}

int zong(int num)
{
	int sum = 0;
	int a = 1;
	while(a == 1)
        {
                sum += num % 10;
                num = num / 10;
                if(num == 0)
                        a = 0;
        }

	return sum;
}
